<?php
/* 
* rt-theme loop
*/


global $args,$which_theme,$more;


add_filter('excerpt_more', 'new_excerpt_more');
				
				
if ($args) query_posts($args);

if ( have_posts() ) : while ( have_posts() ) : the_post(); 
?>
 
  
 
    <!-- blog box-->
    <div class="blog">
	
        <div class="post-image">
            <?php if(has_post_thumbnail()):?>
            <!-- blog image-->
                    <?php				
                        if(!get_option('rttheme_blog_resize'))://RT-Theme resize option is enabled

                        //get the image url
                        $image_id = get_post_thumbnail_id();
                        $image_url = wp_get_attachment_image_src($image_id,'large', true);
                        $image_url = $image_url[0];

                    ?>
                        <a href="<?php echo $image_url;?>" title="<?php the_title(); ?>" rel="prettyPhoto[rt_theme_blog]" ><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $image_url?>&amp;w=680&amp;h=130&amp;zc=1" alt=""  class="aligncenter" /></a>
                    <?php else://use the post thumbnail ?>
                            <?php
                            $default_attr = array('class'	=> "attachment-$size aligncenter post_image preload");
                            echo get_the_post_thumbnail($post->ID,array(680, 200),$default_attr);
                            ?>					
                    <?php endif;?>
            <!-- / blog image -->
            <?php endif;?>
        </div>
        <div class="post-content">
            <div class="title">
                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
            </div>
            <div class="line"></div>
            <div class="excerpt"><?php echo get_the_excerpt(); ?></div>
            <div class="extra">
                <div class="info">
                    <span class="date"><?php the_time("M d"); ?></span> | Categor&iacute;a: <span class="category"><?php the_category(', ') ?> | <?php echo comments_number("0 comentarios","1 comentario","% comentarios"); ?></span>
                </div>
                <div class="view-more"><a href="<?php the_permalink(); ?>">Leer m&aacute;s &raquo;</a></div>
            </div>
        </div>
	
    </div>
    <!-- blog box-->

<?php endwhile;?>
<div class="clear"></div>

<?php
//get page and post counts
$page_count=get_page_count();

//show pagination if page count bigger then 1
if ($page_count['page_count']>1):
?>  
    <!-- paging-->
    <div class="paginator">
        <ul class="paging"><?php get_pagination(); ?></ul>
    </div>
    <!-- / paging-->
<?php endif;?>

<?php wp_reset_query();?>	

<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.', 'rt_theme' ); ?></p>
	<!-- / paging--> 
<?php endif; ?>




	 